Skip to content

[HZ-5434] FencedLock for Asyncio#818

Open
yuce wants to merge 26 commits into
hazelcast:masterfrom
yuce:asyncio-fenced-lock
Open

[HZ-5434] FencedLock for Asyncio#818
yuce wants to merge 26 commits into
hazelcast:masterfrom
yuce:asyncio-fenced-lock

Conversation

@yuce

@yuce yuce commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Ported FencedLock proxy to asyncio.

The asyncore variant uses actual thread IDs to disable re-entrancy.
That's not useful with the asyncio variant, so currently the thread ID 0 is used when necessary.
I've omitted docs that refer to threads, and tests that use threads.
I'll push another PR to add those after lock context implementation.

@codecov-commenter

codecov-commenter commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.65896% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.09%. Comparing base (7ff8ea9) to head (6af970d).

Files with missing lines Patch % Lines
hazelcast/internal/asyncio_proxy/fenced_lock.py 81.16% 29 Missing ⚠️
hazelcast/internal/asyncio_proxy/cp_manager.py 94.44% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #818      +/-   ##
==========================================
- Coverage   94.17%   94.09%   -0.08%     
==========================================
  Files         411      412       +1     
  Lines       27511    27684     +173     
==========================================
+ Hits        25908    26049     +141     
- Misses       1603     1635      +32     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yuce yuce requested a review from emreyigit June 8, 2026 09:04
@emreyigit

Copy link
Copy Markdown
Member

How are you going to protect lock ownership without thread id? There will be concurrent runs, right?

@yuce

yuce commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

How are you going to protect lock ownership without thread id? There will be concurrent runs, right?

The lock is reentrant for lock attempts with the same client, similar to the Node.js client, so data races will happen with operations that uses the same client.
I'll push another PR that uses a pseudo-task ID to be used instead of the thread ID, which will enable us to distinguish between tasks.

@yuce yuce added this to the 5.7.0 milestone Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants